;
; Copyright (c) Microsoft Corporation.  All rights reserved.
;
;
; Use of this source code is subject to the terms of the Microsoft end-user
; license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
; If you did not accept the terms of the EULA, you are not authorized to use
; this source code. For a copy of the EULA, please see the LICENSE.RTF on your
; install media.
;
;------------------------------------------------------------------------------
;
; Copyright (C) 2004-2009, Freescale Semiconductor, Inc. All Rights Reserved.
; THIS SOURCE CODE, AND ITS USE AND DISTRIBUTION, IS SUBJECT TO THE TERMS
; AND CONDITIONS OF THE APPLICABLE LICENSE AGREEMENT 
;
;------------------------------------------------------------------------------
;
;              OS MEMORY MAP                       BOOTLOADER MEMORY MAP
;   
;                            +---- 8000.0000 ----+
;                ARGS (4 KB) |                   | ARGS (4 KB)
;                            +---- 8000.1000 ----+
;            CSPDDK (32 KB)  |                   | Bootloader Page Table (32 KB)
;                            +---- 8000.9000 ----+ 
;                            |                   |
; LCD Frame buffer (2252 KB) |                   | LCD Frame buffer (2252 KB)
;                            |                   | 
;                            +---- 8023.C000 ----+
;      USB KITL DMA (240 KB) |                   |
;                            +---- 8025.C000     |
;            FEC DMA (16 KB) |                   | 
;                            +---- 8026.0000 ----+
;                            |                   | Bootloader Image (256 KB)
;                            +---- 802A.0000 ----+
;                            |                   | Bootloader RAM (256 KB)
;                            +---- 802E.0000 ----+
;                            |                   |
;                            |                   |
;           NK Image (16 MB) |                   |
;                            |                   |
;                            |                   |
;             **auto-size**  +---- 812E.0000     | Flash Cache
;                            |                   | 
;                            |                   |
;                            |                   |
;            NK RAM (45 MB)  |                   |
;                            |                   |
;                            |                   |
;                            |                   |
;                            +---- 8400.0000 ----+
;
;------------------------------------------------------------------------------

;**************************** MEMORY SECTION ***************************
MEMORY

; --------------------------- RAM image --------------------------------
;   Start Addr      End Addr        Mem Type    Region Name     Size
;   0x80000000      0x802E0000      SDRAM       RESERVED        ~3 MB
;   0x802E0000      0x812E0000      SDRAM       NK              16 MB
;   0x812E0000      0x84000000      SDRAM       RAM            ~45 MB
; ----------------------------------------------------------------------
;   Name            Address     Size        Type
    ARGS            80000000    00001000    RESERVED
    PAGE_TABLE      80001000    00008000    RESERVED
    LCDFRAME        80009000    00233000    RESERVED
    USBDMA          8023C000    00020000    RESERVED
    FECDMA          8025C000    00004000    RESERVED
    EBOOTCODE       80260000    00040000    RESERVED
    EBOOTRAM        802A0000    00040000    RESERVED
    NK              802E0000    01000000    RAMIMAGE
    RAM             812E0000    02D20000    RAM

;**************************** CONFIG SECTION ***************************
CONFIG

; ---------------------- All Image Types Settings ----------------------
;   KERNELFIXUPS = ON (sections to which the kernel can write are 
;                      relocated to the start of RAM)
;   SRE = ON (Romimage.exe produces an .sre file)
; ----------------------------------------------------------------------
    KERNELFIXUPS=ON

; --------------------------- RAM image --------------------------------
;   AUTOSIZE = ON (allows NK and RAM space to resize automatically)
;   ROMSIZE  = 02000000 (32 MB)
;   ROMSTART = 802E0000 (NK virtual address base)
;   ROMWIDTH = 32 (32-bit wide memory, entire image in one file)
; ----------------------------------------------------------------------

AUTOSIZE=ON
ROMSIZE =0x02000000
ROMSTART=0x802E0000
ROMWIDTH=32
    
;
; ROMOFFSET applies to the BIN file sections and is used to "move" the image
; into flash.  The bootloader image already on the system will be able to tell
; that the BIN file is destined for flash (versus RAM) based on the address
; formed by RAMIMAGE Start plus ROMOFFSET.
;
IF IMGFLASH
    
    IF IMGSDMMC
        ; Address has to move to IMAGE_BOOT_NKIMAGE_SD_PA_START (which is CSP_BASE_MEM_PA_IRAM + 0xFD400
        ; CSP_BASE_MEM_PA_IRAM is mapped at 0x93700000 (see Topaz\SRC\INC\oemaddrtab_cfg.inc), so adding the above gives:
        ; 0x93700000 + 0xFD400 = 0x937FD400
        ; Set offset so that we push ROMSTART to value calculated above
        ; ROMOFFSET = 0x937FD400 - $(ROMSTART)
        ROMOFFSET=0x1351D400
    ELSE
        ; Address has to move to IMAGE_BOOT_NKIMAGE_NAND_PA_START (which is CSP_BASE_REG_PA_NANDFC + 0x140000
        ; CSP_BASE_REG_PA_NANDFC is mapped at 0x91300000 (see Topaz\SRC\INC\oemaddrtab_cfg.inc), so adding the above gives:
        ; 0x91300000 + 0x140000 = 0x91440000
        ; Set offset so that we push ROMSTART to value calculated above
        ; ROMOFFSET = 0x91440000 - $(ROMSTART)
        ROMOFFSET=0x11160000
	ENDIF
ENDIF

; ------------------------------ COMPRESSION ---------------------------
;   NK COMPRESSION
; ----------------------------------------------------------------------
; @CESYSGEN IF !NK_NKNOCOMP
    COMPRESSION=ON
; @CESYSGEN ENDIF !NK_NKNOCOMP
; @CESYSGEN IF NK_NKNOCOMP
    COMPRESSION=OFF
; @CESYSGEN ENDIF NK_NKNOCOMP

; ---------------------- Profiling-enabled kernel ----------------------
;   PROFILE = ON (includes profiler structure and symbols in image)
; ----------------------------------------------------------------------
IF IMGPROFILER
   PROFILE=ON
ENDIF

; --------------------- Profiling-disabled kernel ----------------------
;   PROFILE = OFF (does not include profiler structure and symbols)
; ----------------------------------------------------------------------
IF IMGPROFILER !
   PROFILE=OFF
ENDIF

;
; ROMFLAGS is a bitmask of options for the kernel
;   ROMFLAGS    0x0001  Disallow Paging
;   ROMFLAGS    0x0002  Not all KMode
;   ROMFLAGS    0x0010  Trust Module only
;
IF IMGTRUSTROMONLY
    IF IMGNOTALLKMODE
       ROMFLAGS=12
    ENDIF
    IF IMGNOTALLKMODE !
       ROMFLAGS=10
    ENDIF
ENDIF

IF IMGTRUSTROMONLY !
    IF IMGNOTALLKMODE
       ROMFLAGS=2
    ENDIF
    IF IMGNOTALLKMODE !
       ROMFLAGS=0
    ENDIF
ENDIF

; FSRAMPERCENT is used to select the percentage of the RAM dedicated to the file system
; check http://msdn.microsoft.com/en-us/library/aa908688.aspx for more info.
; FSRAMPERCENT=0x20202020 => 12.5 % of RAM is used for the file system
FSRAMPERCENT=0x20202020 

; EOF config.bib
